var callBack;

function pageTag(pageNo, pageSize, totalCount, callBackFunc) {
	var pageStr = "";
	
	var totalPage = Math.ceil(totalCount/pageSize);
	var hasPrev = pageNo>1;
	var hasNext = pageNo<totalPage;
	callBack = callBackFunc;
	
	pageStr += "<ul>";
	pageStr += "<li><a href=\"javascript:pageTo(1,"+pageSize+");\"><<</a></li>";
	for(pageNoTmp=1;pageNoTmp<=totalPage;pageNoTmp++){
		pageStr += pageNo==pageNoTmp?"<li class=\"active\">":"<li>";
		pageStr += "<a href=\"javascript:pageTo("+pageNoTmp+","+pageSize+");\">"+pageNoTmp+"</a>";
		pageStr += "</li>";
	}
	pageStr += "<li><a href=\"javascript:pageTo("+totalPage+","+pageSize+");\">>></a></li>";
	pageStr += "</ul>";
	
	$("#pageJQ").html(pageStr);
}

function pageTo(pageNo, pageSize){
	callBack(pageNo, pageSize);
}